package cn.buk.qms.service;

import cn.buk.common.JsonResult;
import cn.buk.common.sc.CommonSearchCriteria;
import cn.buk.tms.dto.ServiceProductDto;
import cn.buk.tms.entity.misc.Product;
import cn.buk.tms.entity.misc.ProductBought;
import cn.buk.tms.entity.misc.TieInProduct;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: yfdai
 * Date: 14-4-17
 * Time: 下午11:07
 * To change this template use File | Settings | File Templates.
 */
public interface ProductService {

    List<Product> findAll();

    Product getProductByCode(String productCode);

    /**
     * 查找购买记录
     * @param enterpriseId
     * @param productCode
     * @return
     */
    ProductBought getProductBoughtByCode(final int enterpriseId, final String productCode);

    /**
     * 购买产品
     * @param enterpriseId  企业ID
     * @param productCode  产品代码
     * @param buyQuantity 购买数量
     * @param enterpriseId 购买企业
     * @return
     */
    int buyProduct(final int enterpriseId, final String productCode, final int buyQuantity, final int buyDays);

    JsonResult buyProduct(final int enterpriseId, final String productCode, final int priceMode);

    JsonResult createTieInProduct(TieInProduct p);

    List<ServiceProductDto> searchTieInProducts(int enterpriseId, CommonSearchCriteria sc);

    JsonResult deleteProduct(int enterpriseId, int id);

    ServiceProductDto searchProductById(int enterpriseId, int id);

    /**
     * 查找VAAS系统提供的服务产品
     * @param enterpriseId
     * @return
     */
    List<ServiceProductDto> searchRemoteServiceProducts(int enterpriseId);
}
